package com.zprmb.udzt;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

 public class V6ResultFinsh extends BaseActivity implements OnClickListener{
	private TextView description1,description2,title;
	private Button btn_intent;
	private RelativeLayout rl_back;
	private ImageView img_back;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.result_finsh);
		BbtApplication.getInstance().addActvity(this);
		setTitle("投资结果", this);
		initview();
	}
	private void initview() {
		// TODO Auto-generated method stub
		description1=(TextView)findViewById(R.id.description1);
		description2=(TextView)findViewById(R.id.description2);
		btn_intent=(Button)findViewById(R.id.btn_intent);
		title=(TextView)findViewById(R.id.tv_title);
		rl_back=(RelativeLayout)findViewById(R.id.rl_back);
		img_back=(ImageView)findViewById(R.id.img_back);
		title.setText(getIntent().getStringExtra("title"));
		description1.setText(getIntent().getStringExtra("description1"));
		description2.setText(getIntent().getStringExtra("description2"));
		btn_intent.setText(getIntent().getStringExtra("button"));
		btn_intent.setOnClickListener(this);
		rl_back.setOnClickListener(this);
		img_back.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent=null;
		switch(v.getId()){
		case R.id.btn_intent:
			if(btn_intent.getText().toString().equals("我的账户")){
				intent=new Intent(V6ResultFinsh.this,MainActivity.class);
				intent.putExtra("regist", 1);
				startActivity(intent);
			}else{
				intent=new Intent(V6ResultFinsh.this,V6MineDexterityActivity.class);
				
				startActivity(intent);
				Intent mIntent = new Intent();
                mIntent.setAction("exit");
                sendBroadcast(mIntent);
				finish();
			}
			break;
		case R.id.rl_back:
			finish();
			break;
		case R.id.img_back:
			finish();
			break;
		}
		
	}

}
